<?php
namespace Realisation\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Description of MessageShow
 *
 * @author pahhan
 */
class MessageShow extends Command
{
    protected function configure()
    {
        $this
            ->setName('message:show')
            ->setDescription('Show message for given id')
            ->addArgument('id', InputArgument::REQUIRED, 'Message id')
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $app = \Realisation\App::getInstance();

        $mesage_array = $app['db']->fetchAssoc('SELECT * FROM message WHERE id = ?', array($input->getArgument('id')));

        print_r($mesage_array);

    }
}

